package com.example.dahua.simplefactory;

import java.util.Scanner;

/**
 * @author: dangwen
 * @createDate: 2021/1/11
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入您要做的运算规则：（+、-、*、/）");
        String next = scanner.next();
        Operation operation = OperationFactory.createOperation(next);
        System.out.println("请输入要做运算的两个数字：");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        operation.setOptionNumberA(a);
        operation.setOptionNumberB(b);
        double result = operation.getResult();
        System.out.println("结果为："+result);

    }
}
